﻿<!DOCTYPE html>
<html>
<head>
  <% include ./user_component/head.ejs%>
  <meta name='viewport' content='width=device-width; initial-scale=1; maximum-scale=1; minimum-scale=1; user-scalable=no;'>
</head>
<body>
<h3>点击想要评教的教师评教</h3>
  <table class="layui-table">
    <colgroup>
      <col width="100">
      <col width="100">
      <col>
    </colgroup>
    <thead>
      <tr>
        <th>姓名</th>
        <th>科目</th>
        <th>是否评教</th>
      </tr> 
    </thead>
    <tbody>
      <% for (let i=0; i<data_h.length; i++){%>
        <tr onClick="aa('<%=data_h[i]._id%>','<%=data_h[i].isPingjiao%>')">
          <td><%=data_h[i].userName%></td>
          <td><%=data_h[i].kemu%></td>
          <td><%=data_h[i].isPingjiao%></td>
        </tr>
        <%}%>
    </tbody>
  </table>



<div style="text-align:center;">
</div>
<script>
  const url = encodeURI('http://127.0.0.1:3001/QselectTeacher')
  const userId = getQueryVariable('userId')
  window.onload = function(){
    console.log(userId)
  // window.location.href=`https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx0eb9cac2e617593c&redirect_uri=${url}&response_type=code&scope=snsapi_base&state=123#wechat_redirect`
  }
  
  function aa(a,aa){
    console.log(aa)
    if(aa === "否"){
      window.location.href=`/Qindex?teacherId=${a}&userId=${userId}`;
    }
    else{
      window.location.href=`/QList?teacherId=${a}&userId=${userId}`;
    }
 
  }
  function getQueryVariable(variable)
{
       var query = window.location.search.substring(1);
       var vars = query.split("&");
       for (var i=0;i<vars.length;i++) {
               var pair = vars[i].split("=");
               if(pair[0] == variable){return pair[1];}
       }
       return(false);
}
</script>
<style>
  h3{
    text-align: center;
    padding: 30px 0;
  }
</style>
</body>
